package cn.xiehangs;

import com.badlogic.gdx.graphics.Texture;
import com.badlogic.gdx.scenes.scene2d.ui.List;
import com.badlogic.gdx.scenes.scene2d.ui.ScrollPane;
import com.badlogic.gdx.scenes.scene2d.ui.TextField;

public class 聊天框  {
    public 聊天框显示部分 聊天框显示部分_1;
    public 聊天框输入部分 聊天框输入部分_1;
    public int stageWidth = 1024/3, stageHeight = 512;
    public int stageHeight_chat_screen = 50;
    int x = 1024;
    int y = 0;
    Texture background;
    LazyBitmapFont font;
    List<String> list2;
    ScrollPane chat;
    TextField send;
    int i=0;
    public 聊天框(String name) {
    聊天框显示部分_1=new 聊天框显示部分(x,y+stageHeight_chat_screen,stageWidth, stageHeight-stageHeight_chat_screen);
    chat = 聊天框显示部分_1.scrollPane;
    聊天框输入部分_1=new 聊天框输入部分(name,x,y,stageWidth, stageHeight_chat_screen,聊天框显示部分_1);
    send = 聊天框输入部分_1.textField;
    }
    public 聊天框(String name,int x,int y,int stageWidth,int stageHeight) {
        this.x = x;
        this.y = y;
        this.stageWidth = stageWidth;
        this.stageHeight = stageHeight;
        聊天框显示部分_1=new 聊天框显示部分(x,y+stageHeight_chat_screen,stageWidth,stageHeight-stageHeight_chat_screen);
        chat = 聊天框显示部分_1.scrollPane;
        聊天框输入部分_1=new 聊天框输入部分(name,x,y,stageWidth, stageHeight_chat_screen,聊天框显示部分_1);
        send = 聊天框输入部分_1.textField;
    }

    public void setflag(boolean flag){
        聊天框显示部分_1.focus = flag;
    }
    public void setX(int x) {
        this.x = x;
        chat.setPosition(x,y);
    }
    public void setY(int y) {
        this.y = y;
        chat.setPosition(x,y);
    }
    public void setStageWidth(int stageWidth) {
        this.stageWidth = stageWidth;
        chat.setWidth(stageWidth);
    }
    public void setStageHeight_chat_screen(int stageHeight_chat_screen) {
        this.stageHeight_chat_screen = stageHeight_chat_screen;
        chat.setHeight(stageHeight_chat_screen);
    }

    public void add(String str){
        聊天框显示部分_1.add(str);
    }

    public void chat(String name, String str) {
        聊天框显示部分_1.chat(name,str);
    }
}
